import request from './../axios'
import { requestHandle } from "../axios";
import { R, API_PREFIX } from "@/assets/js/dict.js"

/**
 * 查询家长的个人信息
 * @param params ｛parent_id：家长id}
 * @returns {AxiosPromise}
 * @constructor
 */
export function detailsInfo (params, callback) {
    requestHandle(request({
        url: `${API_PREFIX}/parent/action/details`,
        method: 'get',
        params
    }), callback);
}

/**
 * 家长退出登录
 * @param callback
 */
export function logoutOfParent (callback) {
    requestHandle(request({
        url: `${API_PREFIX}/logout`,
        method: 'get'
    }), callback);
}



/**
 * 查看家长的个人信息
 * 
 * @method postParentDetails
 * 
 * 
 * @return 
 * {
    "error": "no response from server"
    }
 */

export function getParentDetails (params) {
    return request({
        url: '/parent/action/details',
        method: 'get',
        params
    })
}

/**
 * 修改家长的个人信息
 * 
 * @method postParentUpdate
 * 
 * 
 * @return 
 * {
    "error": "no response from server"
    }
 */

export function postParentUpdate (params) {
    return request({
        url: '/parent/action/update',
        method: 'post',
        params
    })
}

